package ClassWork.Work_05;

import java.lang.reflect.Method;
import java.util.Arrays;

//@Author("男")
@Author({"男","女"})
public class AuthorDemo {
    @Author
    private String str;

    @Author(name = "lisi")
    public static void add() {

    }

    public static void main(String[] args) throws NoSuchMethodException {
        Class<AuthorDemo> clazz = AuthorDemo.class;
        Author authorType = clazz.getAnnotation(Author.class);
        System.out.println(authorType.name());
        System.out.println(authorType.age());
        //System.out.println(authorType.value());
        System.out.println(Arrays.toString(authorType.value()));

        Method method = clazz.getMethod("add");
        Author authorMethod = method.getAnnotation(Author.class);
        System.out.println(authorMethod.name());
        System.out.println(authorMethod.age());
    }
}
